package com.aijk.web.admin.utils;

import com.aijk.web.admin.entity.ext.QuestionExtInfo;

import java.util.ArrayList;
import java.util.List;

public class QuestionUtils {
    public static String[] title = {"1 性别" , "2 年龄" , "3 下列哪些符合您的现状" , "4 您经常参加体育锻炼吗?" , "5 您认为您目前的身体状况是" , "6 您喜欢的健康促进方式有" , "7 您最希望了解哪些知识?" , "8 您最希望多久开展一次健康促进活动?" , "9 您对单位现阶段开展的健康促进活动是否满意?"} ;
    public static String[] title1 = {"男" , "女"} ;
    public static String[] title2 = {"18-25岁" , "26-34岁" , "35-45岁" , "46-55岁" , ">55岁"} ;
    public static String[] title3 = {"缺乏运动" , "熬夜" , "吸烟 " ,"饮酒" , "口味偏咸" , "肥胖"} ;
    public  static String[] title4 = {"每天锻炼" , "每周锻炼3-5天" , "偶尔锻炼" , "从不锻炼"} ;
    public static String[] title5 = {"健康" , "亚健康" , "怀疑患病" , "患病"} ;
    public  static String[] title6 = {"健康讲座" , "义诊咨询" , "健康教育折页" , "版面巡展" , "流动健康驿站" , "健康评比" , "微信发布" , "其他 "} ;
    public static String[] title7 = {"职业安全" , "疾病治疗" , "健康合理饮食" , "健康运动" , "妇女儿童保健" , "中医养生" , "心理咨询" , "用药知识"} ;
    public  static String[] title8 = {"一月1次 " , "一季度1次 " , "半年1次" , "其他"} ;
    public static String[] title9 = {"非常满意" , "比较满意" , "不满意"} ;


   public List<QuestionExtInfo> converQuestionExtInfo(){
       List<QuestionExtInfo> info = new ArrayList<>();
       for (int i = 0 , len = title.length;i<len ;i++ ){
           QuestionExtInfo questionExtInfo = new QuestionExtInfo();
           questionExtInfo.setTitle(title[i]);
           questionExtInfo.setSoft(i+1);
           if(i==0){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int a = 0;a<title1.length ;a++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(a);
                   item.setNo(0);
                   item.setTitle(title1[a]);
                   item.setPercentile("0");
                   items.add(item);

               }
               questionExtInfo.setItems(items);
           }
           if(i==1){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int b = 0;b<title2.length ;b++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(b);
                   item.setNo(0);
                   item.setTitle(title2[b]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==2){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int c = 0;c<title3.length ;c++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(c);
                   item.setNo(0);
                   item.setTitle(title3[c]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==3){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int d = 0;d<title4.length ;d++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(d);
                   item.setNo(0);
                   item.setTitle(title4[d]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==4){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int e = 0;e<title5.length ;e++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(e);
                   item.setNo(0);
                   item.setTitle(title5[e]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==5){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int f = 0;f<title6.length ;f++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(f);
                   item.setNo(0);
                   item.setTitle(title6[f]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==6){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int g = 0;g<title7.length ;g++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(g);
                   item.setNo(0);
                   item.setTitle(title7[g]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==7){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int h = 0;h<title8.length ;h++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(h);
                   item.setNo(0);
                   item.setTitle(title8[h]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           if(i==8){
               List<QuestionExtInfo.QestionInfoItem> items = new ArrayList<>();
               for (int n = 0;n<title9.length ;n++ ){
                   QuestionExtInfo.QestionInfoItem item = new QuestionExtInfo.QestionInfoItem();
                   item.setCount(n);
                   item.setNo(0);
                   item.setTitle(title9[n]);
                   item.setPercentile("0");
                   items.add(item);
               }
               questionExtInfo.setItems(items);
           }
           info.add(questionExtInfo);
       }
       return info;
   }
}
